package cn.cnf.common.enums;

/**
 * @author ZhuMeiYi
 * @date 2020/12/6 18:46
 * @description 漫画&小说 状态
 */
public enum StateEnum {
    /**
     * 连载&完结&已更新
     */
    UPDATING("连载中", 10),
    END("完结", 20),
    PAUSE("暂停", 30);


    /**
     * 类型
     */
    private String state;
    /**
     * 值
     */
    private Integer value;

    StateEnum(String state, Integer value) {
        this.state = state;
        this.value = value;
    }

    public String getState() {
        return state;
    }

    public static StateEnum getByValue(Integer value) {
        for (StateEnum stateEnum : values()) {
            if (stateEnum.getValue().equals(value)) {
                return stateEnum;
            }
        }
        return null;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public void setState(String state) {
        this.state = state;
    }
}
